﻿using System;

namespace diantou.web.exam
{
    /// <summary>
    /// 答卷
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPage = false, IsPool = true)]
    partial class result : view<result>
    {
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private bool loadView(int userId)
        {
            if (base.user != null)
            {
                exam = diantou.examDataAccess.clientCache.Exam[base.user.ExamId];
                if (exam.Type == dataModel.exam.type.完成答卷后发简历的考试) return true;
            }
            if (userId != 0)
            {
                diantou.examDataAccess.examUser user = diantou.examDataAccess.clientCache.ExamUser[userId];
                if (user != null)
                {
                    location(new diantou.dataModel.path.exam { Id = user.ExamId }.Index);
                    return false;
                }
            }
            AjaxResponse(webConfig.NotFound404);
            return false;
        }
    }
}
